from app import db


class Restaurant(db.Model):
    __table_args__ = {
        'mysql_engine': 'InnoDB',
        'mysql_charset': 'utf8'
    }
    restaurant_id = db.Column(db.String(50), primary_key=True)
    restaurant_name = db.Column(db.String(100), nullable=False, default='')
    address = db.Column(db.String(100), nullable=False, default='')
    rating = db.Column(db.DECIMAL(5, 1))
    shop_score = db.Column(db.DECIMAL(5, 1))
    taste_score = db.Column(db.DECIMAL(5, 1))
    package_score = db.Column(db.DECIMAL(5, 1))
    rider_score = db.Column(db.DECIMAL(5, 1))
    restaurant_image = db.Column(db.String(255), nullable=False, default='')
    recent_order_num = db.Column(db.Integer)
    longitude = db.Column(db.DECIMAL(10, 2))
    latitude = db.Column(db.DECIMAL(10, 2))
    is_new = db.Column(db.Boolean)
